<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="br.ronei.FileLineReader"%>
<%@page import="br.ronei.SyslogLineParser"%>
<%
		int count = 0;
		String s = request.getParameter("s");
		FileLineReader flr = new FileLineReader("/WEB-INF/irpims.log",this.getServletContext());
		SyslogLineParser slp = new SyslogLineParser();
		for(int i = 0;i < flr.getTotalLinhas();i++){
			slp.ParseLine(flr.getLinha(i));
			if(slp.getMensagem().contains(s)){
				count++;
			}
		}
		//out.print("<h3>" + flr.getLinha(20498) + "</h3>");
		//out.print("<h3>" + "Dia: " + slp.getDia() + "</h3>");
		//out.print("<h3>" + "Mes: " + slp.getMes() + "</h3>");
		//out.print("<h3>" + "Hora: " + slp.getHora() + "</h3>");
		//out.print("<h3>" + "Host: " + slp.getHost() + "</h3>");
		//out.print("<h3>" + "Servico: " + slp.getServico() + "</h3>");
		//out.print("<h3>" + "Mensagem: " + slp.getMensagem() + "</h3>");
		//out.print("<h3>" + "Conta: " + count + "</h3>");
		out.print(count);
%>